import * as THREE from 'three';
// import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'
const model = new THREE.Group();
const geometry = new THREE.BoxGeometry( 5, 5, 5 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ffff} );
const cube = new THREE.Mesh( geometry, material );
cube.position.set(-10,0,0)
model.add( cube );
const A = new THREE.Vector3(-10,0,0)
const B = new THREE.Vector3(20,0,0)
// 获取AB向量
let AB = B.sub(A)
console.log(AB);
AB.normalize()//向量AB归一化
// cube的位置加上AB向量乘以100
cube.position.add(AB.multiplyScalar(40))
export default {model};